package com.cqkjxy.service;

import com.cqkjxy.commons.services.AbstractService;
import com.cqkjxy.dao.TechProjectDao;
import com.cqkjxy.entity.TechProjectEntity;
import com.cqkjxy.repositories.TechProjectRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class TechProjectService extends AbstractService<TechProjectEntity, TechProjectRepository, TechProjectDao> {

    @Autowired
    private TechProjectDao techProjectDao;

    @Override
    protected TechProjectDao getDao() {
        return techProjectDao;
    }

    @Transactional(readOnly = false)
    public TechProjectEntity save(TechProjectEntity techProjectEntity){
        TechProjectEntity rep = techProjectDao.createOrSave(techProjectEntity);
        return rep;
    }

    public Iterable<TechProjectEntity> findAll(){
        Iterable<TechProjectEntity> all = techProjectDao.findAll();
        return all;
    }


}
